"use client"

import { Suspense } from "react"
import { useSearchParams } from "next/navigation"
import { SharedFileView } from "@/components/shared-file-view"

function SharedPageContent() {
  const searchParams = useSearchParams()
  const shareId = searchParams?.get("shareId") ?? undefined

  if (!shareId) {
    return <div>缺少分享链接参数。</div>
  }

  return <SharedFileView shareId={shareId} />
}

export default function SharedPage() {
  return (
    <Suspense fallback={<div>加载中…</div>}>
      <SharedPageContent />
    </Suspense>
  )
}

